import 'package:fusion_one/dtos/tag.dart';

class Patient {
  String id;
  String patientName;
  int age;
  // 当前治疗阶段
  String? stageTypeName;
  String tegistrationtime;
  List<Tag> tagInfo;
  String? dentalAge;
  String? avatar;

  Patient(
      {required this.id,
      required this.patientName,
      required this.age,
      this.stageTypeName,
      required this.tegistrationtime,
      this.dentalAge,
      required this.tagInfo,
      this.avatar});

  factory Patient.fromJson(Map<String, dynamic> json) {
    return Patient(
        age: json["age"],
        patientName: json["patientName"],
        id: json["id"],
        tegistrationtime: json["tegistrationtime"],
        stageTypeName: json["stageTypeName"],
        dentalAge: json['dentalAge'],
        avatar: json['avatar'],
        tagInfo: (json['tagInfo'] as List<dynamic>)
            .map((e) => Tag.formJson(e))
            .toList());
  }
}
